Skip to content

fix(cli): accept required body fields from flags#85

Closed
ysyneu wants to merge 1 commit into
feat/ai-srefrom
audit-fix/audit-20260714-body-field-sources
Closed

fix(cli): accept required body fields from flags#85
ysyneu wants to merge 1 commit into
feat/ai-srefrom
audit-fix/audit-20260714-body-field-sources

Conversation

@ysyneu

@ysyneu ysyneu commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • let generated required request fields come from positional args, typed flags, or --data
  • keep scalar extra-argument rejection and typed-flag override semantics
  • regenerate every affected command from the shared cligen source

Audit evidence

Production sessions exposed version-skew around channel escalate-rule-list: the command help advertised --channel-id, while the target branch positional validator rejected that source before request assembly. The same contradiction affected every generated required body field.

Verification

  • make GOLANGCI_LINT=/tmp/fc-safari-audit-tools/golangci-lint-current (fmt, lint, race tests, build)
  • make check-cards
  • focused scalar and variadic source tests for positional / typed flag / --data
  • cligen regenerated twice with zero diff drift
  • /simplify --uncommitted
  • /review-to-main --uncommitted
  • /review-to-main

@ysyneu ysyneu left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review blockers(P2):1)CLI 已接受 typed flag/--data 替代 positional,但 skilldoc generator/validator 仍按 Use 将这些 flag 隐藏或判为 positional-as-flag,随包指南与真实 CLI 契约冲突;2)任意非空 --data 都被视为满足必填字段,--data {} 或不含目标字段的 JSON 会绕过 120 个 validator,包括 mutation 命令。请统一命令元数据、skilldoc 生成/校验/卡片,并解析 --data 验证目标字段存在,补负例测试后再合并。

@ysyneu

ysyneu commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

关闭:该 PR 同时留下两类契约缺口:CLI 接受 typed flags/--data,但 skilldoc 仍把它们隐藏或判错;任意 --data 又能绕过必填字段检查。120 个命令的广泛改造不应带着不一致发布;如未来重做,需统一命令元数据、validator、skilldoc 生成与负例测试。

@ysyneu ysyneu closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant